/********************************************
* Copyrigt (C) rumi
* Module: app_serial.hpp
*********************************************/
#ifndef app_serial_H
#define app_serial_H
#include <serial/serial.h>
#include <semaphore.h>
#include <string>
#include "ser_datapack.h"

#define AUTO_UART_NAME   "/dev/ttyS3"
#define AUTO_UART_SPEED   115200

#define SHM_SIZE 64
#define SHM_NAME_RECV "auto_shm_recv"
#define SHM_NAME_SEND "auto_shm_send"

enum DataState {
    DataState_Recvd,
    DataState_Working,  
};

typedef struct{
    sem_t Sem_Notice;          // tell other program that data is ready
    uint8_t DataState;         // data state
    char Data[SHM_SIZE];       // data
}SharedMemory_TypeDef;



extern void APP_Auto_CreateThread();
extern void APP_Auto_System_Cycle();
#endif
/********************************************
 * End of file
*********************************************/